package UnOfficeDeTourisme;

/**
 * Interface definition : SGCartes
 * 
 * @author OpenORB Compiler
 */
public abstract class SGCartesPOA extends org.omg.PortableServer.Servant
        implements SGCartesOperations, org.omg.CORBA.portable.InvokeHandler
{
    public SGCartes _this()
    {
        return SGCartesHelper.narrow(_this_object());
    }

    public SGCartes _this(org.omg.CORBA.ORB orb)
    {
        return SGCartesHelper.narrow(_this_object(orb));
    }

    private static String [] _ids_list =
    {
        "IDL:UnOfficeDeTourisme/SGCartes:1.0"
    };

    public String[] _all_interfaces(org.omg.PortableServer.POA poa, byte [] objectId)
    {
        return _ids_list;
    }

    private static final java.util.Map operationMap = new java.util.HashMap();

    static {
            operationMap.put("ajouterEntree",
                    new Operation_ajouterEntree());
            operationMap.put("ajouterTouriste",
                    new Operation_ajouterTouriste());
            operationMap.put("creerCarte",
                    new Operation_creerCarte());
            operationMap.put("desactiverCarte",
                    new Operation_desactiverCarte());
            operationMap.put("donnerAvis",
                    new Operation_donnerAvis());
            operationMap.put("getEntreesCarte",
                    new Operation_getEntreesCarte());
            operationMap.put("getEntreesVisite",
                    new Operation_getEntreesVisite());
            operationMap.put("listerCartes",
                    new Operation_listerCartes());
            operationMap.put("listerCartesTouriste",
                    new Operation_listerCartesTouriste());
            operationMap.put("passerPortique",
                    new Operation_passerPortique());
    }

    public final org.omg.CORBA.portable.OutputStream _invoke(final String opName,
            final org.omg.CORBA.portable.InputStream _is,
            final org.omg.CORBA.portable.ResponseHandler handler)
    {

        final AbstractOperation operation = (AbstractOperation)operationMap.get(opName);

        if (null == operation) {
            throw new org.omg.CORBA.BAD_OPERATION(opName);
        }

        return operation.invoke(this, _is, handler);
    }

    // helper methods
    private org.omg.CORBA.portable.OutputStream _invoke_ajouterTouriste(
            final org.omg.CORBA.portable.InputStream _is,
            final org.omg.CORBA.portable.ResponseHandler handler) {
        org.omg.CORBA.portable.OutputStream _output;
        String arg0_in = _is.read_string();
        String arg1_in = _is.read_string();
        String arg2_in = _is.read_string();

        int _arg_result = ajouterTouriste(arg0_in, arg1_in, arg2_in);

        _output = handler.createReply();
        _output.write_long(_arg_result);

        return _output;
    }

    private org.omg.CORBA.portable.OutputStream _invoke_creerCarte(
            final org.omg.CORBA.portable.InputStream _is,
            final org.omg.CORBA.portable.ResponseHandler handler) {
        org.omg.CORBA.portable.OutputStream _output;
        int arg0_in = _is.read_long();
        int arg1_in = _is.read_long();

        int _arg_result = creerCarte(arg0_in, arg1_in);

        _output = handler.createReply();
        _output.write_long(_arg_result);

        return _output;
    }

    private org.omg.CORBA.portable.OutputStream _invoke_ajouterEntree(
            final org.omg.CORBA.portable.InputStream _is,
            final org.omg.CORBA.portable.ResponseHandler handler) {
        org.omg.CORBA.portable.OutputStream _output;
        UnOfficeDeTourisme.Entree arg0_in = UnOfficeDeTourisme.EntreeHelper.read(_is);
        int arg1_in = _is.read_long();

        ajouterEntree(arg0_in, arg1_in);

        _output = handler.createReply();

        return _output;
    }

    private org.omg.CORBA.portable.OutputStream _invoke_listerCartes(
            final org.omg.CORBA.portable.InputStream _is,
            final org.omg.CORBA.portable.ResponseHandler handler) {
        org.omg.CORBA.portable.OutputStream _output;

        UnOfficeDeTourisme.Carte[] _arg_result = listerCartes();

        _output = handler.createReply();
        UnOfficeDeTourisme.listeCartesHelper.write(_output,_arg_result);

        return _output;
    }

    private org.omg.CORBA.portable.OutputStream _invoke_listerCartesTouriste(
            final org.omg.CORBA.portable.InputStream _is,
            final org.omg.CORBA.portable.ResponseHandler handler) {
        org.omg.CORBA.portable.OutputStream _output;
        int arg0_in = _is.read_long();

        UnOfficeDeTourisme.Carte[] _arg_result = listerCartesTouriste(arg0_in);

        _output = handler.createReply();
        UnOfficeDeTourisme.listeCartesHelper.write(_output,_arg_result);

        return _output;
    }

    private org.omg.CORBA.portable.OutputStream _invoke_getEntreesVisite(
            final org.omg.CORBA.portable.InputStream _is,
            final org.omg.CORBA.portable.ResponseHandler handler) {
        org.omg.CORBA.portable.OutputStream _output;
        int arg0_in = _is.read_long();
        int arg1_in = _is.read_long();

        try
        {
            UnOfficeDeTourisme.Entree[] _arg_result = getEntreesVisite(arg0_in, arg1_in);

            _output = handler.createReply();
            UnOfficeDeTourisme.listeEntreesHelper.write(_output,_arg_result);

        }
        catch (UnOfficeDeTourisme.ListeVideException _exception)
        {
            _output = handler.createExceptionReply();
            UnOfficeDeTourisme.ListeVideExceptionHelper.write(_output,_exception);
        }
        return _output;
    }

    private org.omg.CORBA.portable.OutputStream _invoke_getEntreesCarte(
            final org.omg.CORBA.portable.InputStream _is,
            final org.omg.CORBA.portable.ResponseHandler handler) {
        org.omg.CORBA.portable.OutputStream _output;
        int arg0_in = _is.read_long();

        try
        {
            UnOfficeDeTourisme.Entree[] _arg_result = getEntreesCarte(arg0_in);

            _output = handler.createReply();
            UnOfficeDeTourisme.listeEntreesHelper.write(_output,_arg_result);

        }
        catch (UnOfficeDeTourisme.ListeVideException _exception)
        {
            _output = handler.createExceptionReply();
            UnOfficeDeTourisme.ListeVideExceptionHelper.write(_output,_exception);
        }
        return _output;
    }

    private org.omg.CORBA.portable.OutputStream _invoke_desactiverCarte(
            final org.omg.CORBA.portable.InputStream _is,
            final org.omg.CORBA.portable.ResponseHandler handler) {
        org.omg.CORBA.portable.OutputStream _output;
        int arg0_in = _is.read_long();

        desactiverCarte(arg0_in);

        _output = handler.createReply();

        return _output;
    }

    private org.omg.CORBA.portable.OutputStream _invoke_passerPortique(
            final org.omg.CORBA.portable.InputStream _is,
            final org.omg.CORBA.portable.ResponseHandler handler) {
        org.omg.CORBA.portable.OutputStream _output;
        int arg0_in = _is.read_long();
        int arg1_in = _is.read_long();

        UnOfficeDeTourisme.Entree[] _arg_result = passerPortique(arg0_in, arg1_in);

        _output = handler.createReply();
        UnOfficeDeTourisme.listeEntreesHelper.write(_output,_arg_result);

        return _output;
    }

    private org.omg.CORBA.portable.OutputStream _invoke_donnerAvis(
            final org.omg.CORBA.portable.InputStream _is,
            final org.omg.CORBA.portable.ResponseHandler handler) {
        org.omg.CORBA.portable.OutputStream _output;
        int arg0_in = _is.read_long();
        int arg1_in = _is.read_long();
        String arg2_in = _is.read_string();

        UnOfficeDeTourisme.Entree[] _arg_result = donnerAvis(arg0_in, arg1_in, arg2_in);

        _output = handler.createReply();
        UnOfficeDeTourisme.listeEntreesHelper.write(_output,_arg_result);

        return _output;
    }

    // operation classes
    private abstract static class AbstractOperation {
        protected abstract org.omg.CORBA.portable.OutputStream invoke(
                SGCartesPOA target,
                org.omg.CORBA.portable.InputStream _is,
                org.omg.CORBA.portable.ResponseHandler handler);
    }

    private static final class Operation_ajouterTouriste extends AbstractOperation
    {
        protected org.omg.CORBA.portable.OutputStream invoke(
                final SGCartesPOA target,
                final org.omg.CORBA.portable.InputStream _is,
                final org.omg.CORBA.portable.ResponseHandler handler) {
            return target._invoke_ajouterTouriste(_is, handler);
        }
    }

    private static final class Operation_creerCarte extends AbstractOperation
    {
        protected org.omg.CORBA.portable.OutputStream invoke(
                final SGCartesPOA target,
                final org.omg.CORBA.portable.InputStream _is,
                final org.omg.CORBA.portable.ResponseHandler handler) {
            return target._invoke_creerCarte(_is, handler);
        }
    }

    private static final class Operation_ajouterEntree extends AbstractOperation
    {
        protected org.omg.CORBA.portable.OutputStream invoke(
                final SGCartesPOA target,
                final org.omg.CORBA.portable.InputStream _is,
                final org.omg.CORBA.portable.ResponseHandler handler) {
            return target._invoke_ajouterEntree(_is, handler);
        }
    }

    private static final class Operation_listerCartes extends AbstractOperation
    {
        protected org.omg.CORBA.portable.OutputStream invoke(
                final SGCartesPOA target,
                final org.omg.CORBA.portable.InputStream _is,
                final org.omg.CORBA.portable.ResponseHandler handler) {
            return target._invoke_listerCartes(_is, handler);
        }
    }

    private static final class Operation_listerCartesTouriste extends AbstractOperation
    {
        protected org.omg.CORBA.portable.OutputStream invoke(
                final SGCartesPOA target,
                final org.omg.CORBA.portable.InputStream _is,
                final org.omg.CORBA.portable.ResponseHandler handler) {
            return target._invoke_listerCartesTouriste(_is, handler);
        }
    }

    private static final class Operation_getEntreesVisite extends AbstractOperation
    {
        protected org.omg.CORBA.portable.OutputStream invoke(
                final SGCartesPOA target,
                final org.omg.CORBA.portable.InputStream _is,
                final org.omg.CORBA.portable.ResponseHandler handler) {
            return target._invoke_getEntreesVisite(_is, handler);
        }
    }

    private static final class Operation_getEntreesCarte extends AbstractOperation
    {
        protected org.omg.CORBA.portable.OutputStream invoke(
                final SGCartesPOA target,
                final org.omg.CORBA.portable.InputStream _is,
                final org.omg.CORBA.portable.ResponseHandler handler) {
            return target._invoke_getEntreesCarte(_is, handler);
        }
    }

    private static final class Operation_desactiverCarte extends AbstractOperation
    {
        protected org.omg.CORBA.portable.OutputStream invoke(
                final SGCartesPOA target,
                final org.omg.CORBA.portable.InputStream _is,
                final org.omg.CORBA.portable.ResponseHandler handler) {
            return target._invoke_desactiverCarte(_is, handler);
        }
    }

    private static final class Operation_passerPortique extends AbstractOperation
    {
        protected org.omg.CORBA.portable.OutputStream invoke(
                final SGCartesPOA target,
                final org.omg.CORBA.portable.InputStream _is,
                final org.omg.CORBA.portable.ResponseHandler handler) {
            return target._invoke_passerPortique(_is, handler);
        }
    }

    private static final class Operation_donnerAvis extends AbstractOperation
    {
        protected org.omg.CORBA.portable.OutputStream invoke(
                final SGCartesPOA target,
                final org.omg.CORBA.portable.InputStream _is,
                final org.omg.CORBA.portable.ResponseHandler handler) {
            return target._invoke_donnerAvis(_is, handler);
        }
    }

}
